const fs =require('fs');

let rs = fs.createReadStream('1.png');
let ws = fs.createReadStream('2.png');

rs.pipe(ws);//通过管道把读取流  => 写入流

rs.on('error',err=>{
    console.log('读取失败');
});

rs.on('finish', ()=>{
    console.log('写入完成');
})